#-*- coding:utf-8 -*- 

'''
Created on 2011-10-28

@author: Botao Wu
'''
import time

def count_time(func):
    def wrapper(*args):
        start = time.clock()
        func(*args)
        end =time.clock()
        print 'used time:', end - start, 'sec'
    return wrapper

@count_time
def foo():
    print 'in foo()'

if __name__ == '__main__':
    foo()